<?php
/**
 * @package    Joomla.Tutorials
 * @subpackage Components
 * @link http://docs.joomla.org/Developing_a_Model-View-Controller_Component_-_Part_2
 * @license    GNU/GPL
*/
 
// No direct access
 
defined( '_JEXEC' ) or die( 'Restricted access' );
 
jimport( 'joomla.application.component.view');
 
/**
 * HTML View class for the JobsWorld Component
 *
 * @package    JobsWorld
 */
 
class JobsViewTilmelding extends JView
{
    function display($tpl = null)
    {
		global $mainframe, $option;
       	//$model = &$this->getModel();
		$session =& JFactory::getSession();
		$data = JModel::getInstance( 'Jobs', 'JobsModel');
		$this->assignRef('data',		$data);
		
		$task = JRequest::getVar('task');
		$id = JRequest::getVar('id');
		$user		= JFactory::getUser();
		$item_user = $data->getOrder($id,$user->id);
		if(isset($task)&& isset($id)) {
			if(!$item_user)
			{
				$app			= JFactory::getApplication();
				$app->redirect(JRoute::_('index.php?option=com_jobs&view=tilmelding', false));
			} else {
				$this->assignRef('item_user',		$item_user);
			}
		} 
		/*
		$items		= $this->get('data');
		$total		= $this->get('total');
		$pagination	= &$this->get('pagination');
		
		$mainframe->setUserState($option.'filter_state','P');
		$mainframe->setUserState($option.'filter_order_Dir','DESC');
		
		$this->assignRef( 'items',	$items );
		$this->assignRef( 'total',	$total );
		$this->assignRef( 'pagination',	$pagination );
		$this->assignRef( 'model',	$model );
		*/
		/*
		$rows = $model->getListJobs($model->getState('limitstart'), $model->getState('limit'));
		$this->assignRef( 'rows',	$rows );
		$rows_total = $model->getTotalJobs();
		
		$pagination	= $model->getPagination($rows_total);
		$this->assignRef( 'pagination',	$pagination );
		$this->assignRef( 'model',	$model );
		*/
		
		/*
        $greeting = $model->getGreeting();
        $this->assignRef( 'greeting',	$greeting );
 		*/
        parent::display($tpl);
    }
}
?>